package led.control;

import android.content.Intent;
import android.os.Bundle;
import android.preference.CheckBoxPreference;
import android.preference.PreferenceActivity;
import android.preference.PreferenceScreen;
import android.util.Log;

public class SettingPreferencActivity extends PreferenceActivity {
	// Debugging
	private static final String TAG = "SettingPreferencActivity";
	private static final boolean D = true;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setPreferenceScreen(createPreferenceSetting());
		Intent intent = new Intent(this, BluetoothConn.class);
		setResult(RESULT_OK, intent);
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		if (D)
			Log.e(TAG, "[onDestroy]");

		finish();
	}

	private PreferenceScreen createPreferenceSetting() {
		PreferenceScreen root = getPreferenceManager().createPreferenceScreen(this);

		// PreferenceCategory signalPrefCat = new PreferenceCategory(this);
		// signalPrefCat.setTitle(R.string.signal_level_pref_category);
		// root.addPreference(signalPrefCat);

		CheckBoxPreference togglePref = new CheckBoxPreference(this);
		togglePref.setKey(BluetoothConn.KEY_ECHO_PREF);
		togglePref.setPersistent(true);
		togglePref.setTitle("Echo Setting");
		root.addPreference(togglePref);
		return root;
	}

}
